<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page session="true"%>
<html>
<head>
<meta charset="UTF-8">
<script src="./js/jQuery.js"></script>
<script src="./js/news.js"></script>
<link
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
	rel="stylesheet">
<title>新闻管理</title>
</head>
<body>
	<div class="alert" id="alert"
		style="position: absolute; width: 100%; padding: 0px"></div>
	<br>
	<br>
	<div class="container">
		<div class="masthead">
			<form method="post">
				<table border="1" width="100%" class="table table-striped">
					<tr>
						<!-- <th><input type="checkbox" id="chbAll"></th> -->
						<th>ID</th>
						<th>标题</th>
						<th>摘要</th>
						<th>出版日期</th>
						<th>操作</th>
					</tr>
					<tbody id="tableBody">
						<c:forEach var="NewsInfo" items="${NewsInfos}">
							<tr>
								<!-- <th><input type="checkbox" name="ids" value="${NewsInfo.id}"  ></th> -->
								<td style="vertical-align: middle;">${NewsInfo.id}</td>
								<td style="vertical-align: middle;">${NewsInfo.head}</td>
								<td style="vertical-align: middle;">${NewsInfo.body}</td>
								<td style="vertical-align: middle;"><fmt:formatDate
										value="${NewsInfo.date}" pattern="yyyy年MM月dd日" /></td>
								<td style="vertical-align: middle;"><a
									href="/News/readNews.html?id=${NewsInfo.id}"
									class="btn btn btn-primary">查看</a> <a
									href="/News/updateNews.html?id=${NewsInfo.id}"
									class="btn btn btn-success">编辑</a> <a
									href="/News/deleteNews.html?id=${NewsInfo.id}"
									class="btn btn btn-danger">删除</a></td>
							</tr>
						</c:forEach>
					</tbody>

				</table>
			</form>
		</div>
	</div>
	<script type="text/javascript">
		var _code = '${code}';
		var _message = '${message}';
		if(_code==200){
			alertDelay(1, _message);
		}else if(_code==101){
			alertDelay(3, _message);
		}
	</script>
</body>
</html>